//
//  FindRegisterView.m
//  Find
//
//  Created by lanou3g on 15/11/12.
//  Copyright © 2015年 Reiko. All rights reserved.
//

#import "FindRegisterView.h"

@implementation FindRegisterView


- (instancetype) initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = kFindListCellLabelTextColor;
        [self addSubViews];
    }
    return self;
}


- (void)addSubViews{
    
    
    if (kScreenWidth == 320 && kScreenHeight == 568) {
        self.buttonBigFont = 24;
    } else if (kScreenWidth == 320 && kScreenHeight == 480) {
        self.buttonBigFont = 28;
    } else if (kScreenWidth == 375 && kScreenHeight == 667) {
        self.buttonBigFont = 30;
    } else {
        self.buttonBigFont = 32;
    }
    
    
    
    
    UIImageView *bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, (kScreenHeight-64)*0.2)];
    bgImageView.image = [UIImage imageNamed:@"loginBG.jpg"];
    [self addSubview:bgImageView];
    
    self.userNameTextField = [[UITextField alloc] initWithFrame:CGRectMake(kScreenWidth*0.1, CGRectGetMaxY(bgImageView.frame), kScreenWidth*0.8, (kScreenHeight-64)*0.07)];
    self.userNameTextField.backgroundColor = [UIColor whiteColor];
    self.userNameTextField.placeholder = @"请输入用户名";
    UIImageView *userLeft = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetHeight(self.userNameTextField.frame)*0.2, 0, CGRectGetHeight(self.userNameTextField.frame)*0.8, CGRectGetHeight(self.userNameTextField.frame)*0.8)];
    userLeft.image = [UIImage imageNamed:@"login-user"];
    self.userNameTextField.leftView = userLeft;
    self.userNameTextField.leftViewMode = UITextFieldViewModeAlways;
    [self addSubview:self.userNameTextField];
    
    
    self.passWordTextField1 = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.userNameTextField.frame), CGRectGetMaxY(self.userNameTextField.frame)+(kScreenHeight-64)*0.03, CGRectGetWidth(self.userNameTextField.frame), CGRectGetHeight(self.userNameTextField.frame))];
    self.passWordTextField1.backgroundColor = [UIColor whiteColor];
    self.passWordTextField1.placeholder = @"请输入密码,至少6个字符";
    UIImageView *passwordLeft1 = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetHeight(self.passWordTextField1.frame)*0.2, 0, CGRectGetHeight(self.passWordTextField1.frame)*0.8, CGRectGetHeight(self.passWordTextField1.frame)*0.8)];
    passwordLeft1.image = [UIImage imageNamed:@"login-password"];
    self.passWordTextField1.leftView = passwordLeft1;
    self.passWordTextField1.leftViewMode = UITextFieldViewModeAlways;
    self.passWordTextField1.secureTextEntry = YES;
    [self addSubview:self.passWordTextField1];
    
    
    self.passWordTextField2 = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.passWordTextField1.frame), CGRectGetMaxY(self.passWordTextField1.frame)+(kScreenHeight-64)*0.03, CGRectGetWidth(self.passWordTextField1.frame), CGRectGetHeight(self.passWordTextField1.frame))];
    self.passWordTextField2.backgroundColor = [UIColor whiteColor];
    self.passWordTextField2.placeholder = @"请再次输入密码";
    UIImageView *passwordLeft2 = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetHeight(self.passWordTextField2.frame)*0.2, 0, CGRectGetHeight(self.passWordTextField2.frame)*0.8, CGRectGetHeight(self.passWordTextField2.frame)*0.8)];
    passwordLeft2.image = [UIImage imageNamed:@"login-password"];
    self.passWordTextField2.leftView = passwordLeft2;
    self.passWordTextField2.leftViewMode = UITextFieldViewModeAlways;
    self.passWordTextField2.secureTextEntry = YES;
    [self addSubview:self.passWordTextField2];
    
    
    self.mailTextField = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.passWordTextField2.frame), CGRectGetMaxY(self.passWordTextField2.frame)+(kScreenHeight-64)*0.03, CGRectGetWidth(self.passWordTextField2.frame), CGRectGetHeight(self.passWordTextField2.frame))];
    self.mailTextField.backgroundColor = [UIColor whiteColor];
    self.mailTextField.placeholder = @"请输入邮箱";
    UIImageView *mailLeft = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetHeight(self.mailTextField.frame)*0.2, 0, CGRectGetHeight(self.mailTextField.frame)*0.8, CGRectGetHeight(self.mailTextField.frame)*0.8)];
    mailLeft.image = [UIImage imageNamed:@"login-mail"];
    self.mailTextField.leftView = mailLeft;
    self.mailTextField.leftViewMode = UITextFieldViewModeAlways;
    [self addSubview:self.mailTextField];
    
    self.phoneNumTextField = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.mailTextField.frame), CGRectGetMaxY(self.mailTextField.frame)+(kScreenHeight-64)*0.03, CGRectGetWidth(self.mailTextField.frame), CGRectGetHeight(self.mailTextField.frame))];
    self.phoneNumTextField.backgroundColor = [UIColor whiteColor];
    self.phoneNumTextField.placeholder = @"请输入电话号码";
    UIImageView *phoneLeft = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetHeight(self.phoneNumTextField.frame)*0.2, 0, CGRectGetHeight(self.phoneNumTextField.frame)*0.8, CGRectGetHeight(self.phoneNumTextField.frame)*0.8)];
    phoneLeft.image = [UIImage imageNamed:@"login-phone"];
    self.phoneNumTextField.leftView = phoneLeft;
    self.phoneNumTextField.leftViewMode = UITextFieldViewModeAlways;
    [self addSubview:self.phoneNumTextField];
    
    self.registerButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.registerButton.frame = CGRectMake(kScreenWidth*0.25, (kScreenHeight-64)*0.8, kScreenWidth*0.5, (kScreenHeight-64)*0.08);
//    self.registerButton.backgroundColor = [UIColor redColor];
    [self.registerButton setTitle:@"开始寻觅" forState:UIControlStateNormal];
    [self.registerButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    self.registerButton.titleLabel.font = [UIFont boldSystemFontOfSize:self.buttonBigFont];
    [self addSubview:self.registerButton];
    
    
    
    
    
    
}


@end
